#!/usr/bin/env bash

set -e -u -x
root_dir="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
# shellcheck source=tasks/helpers.sh
source "$root_dir/tasks/helpers.sh"

task_version="3.44.0"
task_hash="d6c9c0a14793659766ee0c06f9843452942ae6982a3151c6bbd78959c1682b82"
if [ "$TARGETARCH" == "arm64" ]; then
  task_hash="3b2a79a5372e3806c4b345bdfb4a1a1a93a287a58804986bb57b16665db5db22"
fi

task_working_dir
download "https://github.com/go-task/task/releases/download/v$task_version/task_linux_${TARGETARCH}.tar.gz" "sha256" "$task_hash"
extract_download "task_linux_${TARGETARCH}.tar.gz"
cp ./task "$WORK_DIR/task"

stamp
